<table width="100%">
  <% if @contents.length > 0 %>
	<th>No.</th>
	<th>Title</th>
	<th>Category</th>
	<th>Author</th>
	<th>Published Date</th>
	<th>Comments</th>
  <%else%>
    <tr><td valign="center" align="center">No Articles Found</td><tr>
  <%end%>
	<% if params[:page] %>
		<% @iID = ((params[:page].to_i - 1) * @items_per_page)  %>
	<% else %>
		<% @iID = 0 %>
	<% end %>
	<% for @content in @contents%>
		<% content_tag_for(:tr, @content) do %>
			<% @iID = @iID + 1 %>
			<td align="center"><%=h @iID %></td>
			<td><%=h link_to @content.title,:controller => :content, :action => :showArticle, :article_id => @content.article_id %></td>
			<td align="center"><%=h @content.categoryname %></td>
			<td align="center"><%=h link_to @content.author, :controller => :profile, :id => @content.user_id %></td>
			<td align="center"><%=h @content.publishdate.to_datetime.strftime('%Y-%m-%d %H:%M:%S') %></td>
			<td align="center"><%=h @content.total_reply %></td>
		<% end %>
	<% end %>
</table>
